</head>
<body>
<div class="f-sep10"></div>
<div class="f-sep10"></div>
<div class="m-hd m-tabs">
  <h2 class="u-tt">{$action_name}管理组</h2>
  <ul id="tabs">
    <li> <a class="z-crt" href="#tab1"><span class="icon">&#xf05a;</span> 基本信息</a></li>
    <li> <a href="#tab2"><span class="icon">&#xf05a;</span> 权限设置</a></li>
  </ul>
</div>
<div class="f-sep10"></div>
<div class="m-form">
  <form action="<?php echo url('user_group/'.$action.'_save'); ?>" method="post" id="form">
    <fieldset>
      <div id="tab1">
        <div class="formitm">
          <label class="lab" >管理组名称：</label>
          <div class="ipt">
            <input name="name" type="text" class="u-ipt" id="name" value="{$info.name}" datatype="s1-20" errormsg="管理组名称至少1~20个字符！" />
            <span class="Validform_checktip"></span> </div>
        </div>
        <!--if:{$user['level']==1}-->
        <div class="formitm">
          <label class="lab" >管理等级：</label>
          <div class="ipt">
            <select name="level" id="level">
          	<option value="1" <!--if:{$info['level']==1}--> selected="selected" <!--{/if}--> >一级管理组</option>
            <option value="2" <!--if:{$info['level']==2}--> selected="selected" <!--{/if}--> >二级管理组</option>
            <option value="3" <!--if:{$info['level']==3}--> selected="selected" <!--{/if}--> >三级管理组</option>
          </select>
            <span class="Validform_checktip">低级别将看不到高级别的管理组与所属用户(只有级别等于一级的用户才可设置级别，默认三级用户)</span> </div>
        </div>
        <!--{/if}-->
      </div>
      <div id="tab2">
      	<?php
        if(!empty($model_purview)){
            foreach ($model_purview as $key => $app) {
                if(!empty($app)){
                    foreach ($app as $list_mode => $list) {
        ?>
            <div class="formitm">
              <label class="lab" >{$list.name}：</label>
              <div class="ipt">
                  <?php if(!empty($list['auth'])){ foreach ($list['auth'] as $action => $vo) { ?>
                  	<?php $model_purview_array=unserialize($info['model_purview']); if(in_array($key.'_'.$list_mode.'_'.$action,(array)$model_purview_array)){ $checked='checked'; }else { $checked= '' ;} ?>
                    <input name="model_purview[]" {$checked} type="checkbox" value="{$key}_{$list_mode}_{$action}"> {$vo}&nbsp;&nbsp;
                  
                  <?php }} ?>
              </div>
            </div>
            <?php
            
		             }
                }
            }
        }
             ?>
            
      </div>
      <div class="formitm formitm-1">
        <button class="u-btn" id="submit" type="submit">保存修改</button>
        <button class="u-btn u-btn-c4" id="reset" type="button">重置</button>
        <span id="tip" class="load"></span> </div>
    </fieldset>
    <input name="gid" type="hidden" value="{$info.gid}" />
  </form>
</div>
</body>
<script>
Do.ready('base','form','tabs', function() {
	saveform('{$url(user_group/index)}');
	tabs();
});
</script>